
<div class="layui-form-item">
  <label class="layui-form-label">标题<span></span></label>
  <div class="layui-input-inline">
	<input type="text"  placeholder="" name="title" id="info_title" class="layui-input modelform_title" value="{$r?$r['title']:''}" style="" autocomplete="off">
  </div>
</div>	
<div class="layui-form-item">
  <label class="layui-form-label">缩略图<span></span></label>
  <div class="layui-input-inline file-upload">
		<input type="text" name="thumb" id="info_thumb" value="{$r?$r['thumb']:''}" autocomplete="off" class="layui-input"/>
		<div class="layui-btn-group">
			<button type="button" class="layui-btn" onclick="previewImg('info_thumb')"><i class="layui-icon">&#xe64a;</i>预览</button>
			<button type="button" class="layui-btn fastupimg" data-input_id="info_thumb" data-listtype="img" id="info_thumb_Picker"><i class="layui-icon">&#xe608;</i>上传</button>
			<button type="button" class="layui-btn" onClick="selectfile('info_thumb','','img')"><i class="layui-icon">&#xe67c;</i>浏览</button>
		</div>
  </div>
</div>	
<div class="layui-form-item">
  <label class="layui-form-label">时间2<span></span></label>
  <div class="layui-input-inline">
	<input type="text"  placeholder="" autocomplete="off" name="newstime" id="info_newstime" value="<?=$r?date("Y-m-d",$r['newstime']):date("Y-m-d")?>" style=""  data-format="yyyy-MM-dd" class="layui-input form-date">
  </div>
</div>
<div class="layui-form-item">
  <label class="layui-form-label">年级<span></span></label>
  <div class="layui-input-inline">
	<input type="text"  placeholder="" name="nianji" id="info_nianji" class="layui-input modelform_nianji" value="{$r?$r['nianji']:''}" style="" autocomplete="off">
  </div>
</div>	
<div class="layui-form-item">
  <label class="layui-form-label">爱好<span></span></label>
  <div class="layui-input-inline">
	  <div class="layui-col-md12">
		<input type="checkbox"  name="hobby[]" value="上网" title="上网" {:strstr($r['hobby'],'|上网|')?"checked":""} /></label><input type="checkbox"  name="hobby[]" value="看电影" title="看电影" {:strstr($r['hobby'],'|看电影|')?"checked":""} /></label><input type="checkbox"  name="hobby[]" value="打游戏" title="打游戏" {:strstr($r['hobby'],'|打游戏|')?"checked":""} /></label>
	  </div>
  </div>
</div>
<div class="layui-form-item">
  <label class="layui-form-label">性别<span></span></label>
  <div class="layui-input-inline">
	  <div class="layui-col-md12">
		<input type="radio"  name="sex" value="男" title="男" {:$r['sex']=='男'?"checked":""} /></label><input type="radio"  name="sex" value="女" title="女" {:$r['sex']=='女'?"checked":""} {$r?"":"checked"}/></label>
	  </div>
  </div>
</div>
<div class="layui-form-item">
  <label class="layui-form-label">简介</label>
  <div class="layui-input-inline">
	<textarea autocomplete="off" name="intro" id="info_intro" style="" class="layui-input">{$r?$r['intro']:''}</textarea>
  </div>
</div>	
<div class="layui-form-item">
	<label class="layui-form-label">相册<span></span></label>
    <div class="layui-input-inline morepic">
        <div class="morepic_box">
            <div class="piclist" data-field="photos">
                <ul id="photos_piclist_ul">
                    <?php
                    if($r){
                        $morepic=$r['photos'];
                        $morepic_arr=explode("\r\n",$morepic);
                        foreach($morepic_arr as $v){
                            if(!$v){break;};
                            $vs=explode("||",$v);
                    ?>
                    <li title="拖动我是可以排序的哦" draggable="false">
                        <a class="piclist_img photos_fancybox" rel="photos_rel" title="<?=$vs[2]?>" href="<?=$vs[1]?>">
                            <img src="<?=$vs[0]?>" draggable="false">
                            <input type="hidden" name="photos_smallimg[]" value="<?=$vs[0]?>">
                            <input type="hidden" name="photos_bigimg[]" value="<?=$vs[1]?>">
                        </a>
                        <div class="piclist_title"><input type="text" name="photos_imgname[]" value="<?=$vs[2]?>"></div>
                        <div class="file-panel"><span class="cancel" onclick="delete_li(this)" title="删除图片">删除</span></div>
                    </li>
                    <?php
                        }                     
                    }
                    ?>
                    <li class="add_morepic" id="photos_add_button" title="增加图片" onclick="selectfiles('photos',moreimg,'img','1000','')">
                        <div class="piclist_img">+</div>
                    </li>                                                
                    <div class="clear"></div>
                </ul>
            </div>                                        
        </div>
    </div>
</div>
<div class="layui-form-item">
  <label class="layui-form-label">附件<span></span></label>
  <div class="layui-input-inline file-upload">
		<input type="text" name="files" id="info_files" autocomplete="off" class="layui-input modelform_files" value="{$r?$r['files']:''}" style=""/>
		<div class="layui-btn-group">
			<button type="button" class="layui-btn" onclick="downloadFile('info_files')"><i class="layui-icon">&#xe601;</i>下载</button>
			<button type="button" class="layui-btn fastupimg" data-input_id="info_files" data-listtype="file" id="info_files_Picker"><i class="layui-icon">&#xe608;</i>上传</button>
			<button type="button" class="layui-btn" onClick="selectfile('info_files','','file')"><i class="layui-icon">&#xe67c;</i>浏览</button>
		</div>
  </div>
</div>	
<div class="layui-form-item">
  <label class="layui-form-label">视频<span></span></label>
  <div class="layui-input-inline file-upload">
		<input type="text" name="video" id="info_video" autocomplete="off" class="layui-input modelform_video" value="{$r?$r['video']:''}" style=""/>
		<div class="layui-btn-group">
			<button type="button" class="layui-btn" onclick="playVideo('info_video')"><i class="layui-icon">&#xe6ed;</i>播放</button>
			<button type="button" class="layui-btn fastupimg" data-input_id="info_video" data-listtype="video" id="info_video_Picker"><i class="layui-icon">&#xe608;</i>上传</button>
			<button type="button" class="layui-btn" onClick="selectfile('info_video','','video')"><i class="layui-icon">&#xe67c;</i>浏览</button>
		</div>
  </div>
</div>	
<div class="layui-form-item">
  <label class="layui-form-label">多选下拉<span></span></label>
  <div class="layui-input-inline">
        <select lay-ignore name="selects[]" multiple="multiple" class="select2" style=""><option value="北京" {:strstr($r['selects'],'|北京|')?"selected":""} >北京</option><option value="上海" {:strstr($r['selects'],'|上海|')?"selected":""} >上海</option><option value="南京" {:strstr($r['selects'],'|南京|')?"selected":""} >南京</option><option value="西藏" {:strstr($r['selects'],'|西藏|')?"selected":""} >西藏</option><option value="南昌" {:strstr($r['selects'],'|南昌|')?"selected":""} >南昌</option></select>
    </div>
</div>
<div class="layui-form-item">
  <label class="layui-form-label">城市<span></span></label>
  <div class="layui-input-inline">
        <select lay-ignore name="city" class="select2" style=""><option value="北京" {$r['city']=='北京'?"selected":""} >北京</option><option value="上海" {$r['city']=='上海'?"selected":""} >上海</option><option value="广州" {$r['city']=='广州'?"selected":""} >广州</option></select>
    </div>
</div>
<div class="layui-form-item">
  <label class="layui-form-label">价格<span></span></label>
  <div class="layui-input-inline">
	<input type="text"  placeholder="" name="price" id="info_price" class="layui-input modelform_price" value="{$r?$r['price']:''}" style="" autocomplete="off">
  </div>
</div>	
<div class="layui-form-item baidu_map_field">
  <label class="layui-form-label">百度地图<span></span></label>
  <div class="layui-input-inline">
      <div class="controls map_show" id="map_mapshow" style="height:400px;"></div>
	<input type="text" id="map_search_val" placeholder="请输入精确的地址，便于地图定位。" class="layui-input map_search_value"  style="width:60%" autocomplete="off">
        <input type="button" value="定位" id="map_search_button" class="layui-btn layui-btn-primary map_search_button">
	<input type="hidden" name="map" id="map_map_point" class="map_point" value="{$r?$r['map']:''}">
        
  </div>
</div>	
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak={:config('app.baidu_map_key')}"></script>
<div class="layui-form-item">
	<label class="layui-form-label">多值字段<span></span></label>
    <div class="layui-input-inline morevalue">
		<script>
			var morevalue_form_js='<tr><td class="morevalue_input"><input class="layui-input" placeholder="" value="" name="morevalue_0[]"></td><td class="morevalue_image"><input value="" id="randImgId" name="morevalue_1[]"><button type="button" class="choose_file" onClick="selectfile(\'randImgId\',\'\',\'img\',\'\',\'\')">选择</button></td><td class="morevalue_video"><input value="" id="randVideoId" name="morevalue_2[]"><button type="button" class="choose_file" onClick="selectfile(\'randVideoId\',\'\',\'video\',\'\',\'\')">选择</button></td><td class="morevalue_file"><input value="" id="randFileId" name="morevalue_3[]"><button type="button" class="choose_file" onClick="selectfile(\'randFileId\',\'\',\'file\',\'\',\'\')">选择</button></td><td class="morevalue_button"><a class="layui-btn layui-btn-primary layui-btn-sm" onclick="morevalue_add(this,morevalue_form_js)"><i class="layui-icon">&#xe654;</i></a><a class="layui-btn layui-btn-primary layui-btn-sm" onclick="morevalue_del(this)"><i class="layui-icon">&#xe640;</i></a></td></tr>';
		</script>
		<table class="layui-table" style="border-right:1px solid #ccc">
			<thead><tr><th style="width:20%">标题<input type="hidden" name="morevalue_morevalue_len[]" placeholder="我只是用于在保存信息的时候用来判断一共有几个morevalue字段的"></th><th style="width:20%">图片<input type="hidden" name="morevalue_morevalue_len[]" placeholder="我只是用于在保存信息的时候用来判断一共有几个morevalue字段的"></th><th style="width:20%">视频<input type="hidden" name="morevalue_morevalue_len[]" placeholder="我只是用于在保存信息的时候用来判断一共有几个morevalue字段的"></th><th style="width:20%">文件<input type="hidden" name="morevalue_morevalue_len[]" placeholder="我只是用于在保存信息的时候用来判断一共有几个morevalue字段的"></th><th style="width:10%">操作</th></tr></thead>
			<tbody>
				<?php
				if($r['morevalue']){
					$morevalue=$r['morevalue'];
					$morevalue_arr=explode("{{RsSplit}}",$morevalue);
					foreach($morevalue_arr as $k=> $v){
						if(!$v){break;}
						$vs=explode("{{FieldSplit}}",$v);
				?>				
				<tr><td class="morevalue_input"><input class="layui-input" placeholder="" value="<?=$r?$vs['0']:''?>" name="morevalue_0[]"></td><td class="morevalue_image"><input value="<?=$r?$vs['1']:''?>" id="morevalue_1_<?=$k?>" name="morevalue_1[]"><button type="button" class="choose_file" onClick="selectfile('morevalue_1_<?=$k?>','','img','','')">选择</button></td><td class="morevalue_video"><input value="<?=$r?$vs['2']:''?>" id="morevalue_2_<?=$k?>" name="morevalue_2[]"><button type="button" class="choose_file" onClick="selectfile('morevalue_2_<?=$k?>','','video','','')">选择</button></td><td class="morevalue_file"><input value="<?=$r?$vs['3']:''?>" id="morevalue_3_<?=$k?>" name="morevalue_3[]"><button type="button" class="choose_file" onClick="selectfile('morevalue_3_<?=$k?>','','file','','')">选择</button></td><td class="morevalue_button"><a class="layui-btn layui-btn-primary layui-btn-sm" onclick="morevalue_add(this,morevalue_form_js)"><i class="layui-icon">&#xe654;</i></a><a class="layui-btn layui-btn-primary layui-btn-sm" onclick="morevalue_del(this)"><i class="layui-icon">&#xe640;</i></a></td></tr>
				<?php
					}                     
				}else{
				?>
				<tr><td class="morevalue_input"><input class="layui-input" placeholder="" value="<?=$r?$vs['0']:''?>" name="morevalue_0[]"></td><td class="morevalue_image"><input value="<?=$r?$vs['1']:''?>" id="morevalue_1_<?=$k?>" name="morevalue_1[]"><button type="button" class="choose_file" onClick="selectfile('morevalue_1_<?=$k?>','','img','','')">选择</button></td><td class="morevalue_video"><input value="<?=$r?$vs['2']:''?>" id="morevalue_2_<?=$k?>" name="morevalue_2[]"><button type="button" class="choose_file" onClick="selectfile('morevalue_2_<?=$k?>','','video','','')">选择</button></td><td class="morevalue_file"><input value="<?=$r?$vs['3']:''?>" id="morevalue_3_<?=$k?>" name="morevalue_3[]"><button type="button" class="choose_file" onClick="selectfile('morevalue_3_<?=$k?>','','file','','')">选择</button></td><td class="morevalue_button"><a class="layui-btn layui-btn-primary layui-btn-sm" onclick="morevalue_add(this,morevalue_form_js)"><i class="layui-icon">&#xe654;</i></a><a class="layui-btn layui-btn-primary layui-btn-sm" onclick="morevalue_del(this)"><i class="layui-icon">&#xe640;</i></a></td></tr>
				<?php
				}
				?>									
			</tbody>
		</table>
    </div>
</div>
<div class="layui-form-item">
  <label class="layui-form-label">详情<span></span></label>
  <div class="layui-input-inline">
        <div class="news_editor" editor_name="newstext" editor_width="%" editor_height="500" imgwidth="1000" imgheight=""><script id="newstext" name="newstext" type="text/plain">{$r?htmlspecialchars_decode($r['newstext']):''}</script></div>
        远程图片保存本地<input type="checkbox" name="newstext_saveFile" lay-ignore value="1" checked> &nbsp;&nbsp;
        提取第一张图做为缩略图（如果缩略图为空的情况下）<input type="checkbox" lay-ignore  name="newstext_getFirstImg" value="1">   
  </div>
</div>	